#ifndef __OSA_ERRNO_H__
#define __OSA_ERRNO_H__

#if defined(__linux) || defined(_WIN32) || defined(__IAR_SYSTEMS_ICC__)
#include <errno.h>
#endif

/*
 * POSIX Error codes
 */
#ifndef EPERM
#define	EPERM		1		/* Not owner */
#endif

#ifndef ENOENT
#define	ENOENT		2		/* No such file or directory */
#endif

#ifndef ESRCH
#define	ESRCH		3		/* No such process */
#endif

#ifndef EINTR
#define	EINTR		4		/* Interrupted system call */
#endif

#ifndef EIO
#define	EIO		    5		/* I/O error */
#endif

#ifndef ENXIO
#define	ENXIO		6		/* No such device or address */
#endif

#ifndef E2BIG
#define	E2BIG		7		/* Arg list too long */
#endif

#ifndef ENOEXEC
#define	ENOEXEC		8		/* Exec format error */
#endif

#ifndef EBADF
#define	EBADF		9		/* Bad file number */
#endif

#ifndef ECHILD
#define	ECHILD		10		/* No children */
#endif

#ifndef EAGAIN
#define	EAGAIN		11		/* No more processes */
#endif

#ifndef ENOMEM
#define	ENOMEM		12		/* Not enough core */
#endif

#ifndef EACCES
#define	EACCES		13		/* Permission denied */
#endif

#ifndef EFAULT
#define	EFAULT		14		/* Bad address */
#endif

#ifndef ENOTEMPTY
#define	ENOTEMPTY	15		/* Directory not empty */
#endif

#ifndef EBUSY
#define	EBUSY		16		/* Mount device busy */
#endif

#ifndef EEXIST
#define	EEXIST		17		/* File exists */
#endif

#ifndef EXDEV
#define	EXDEV		18		/* Cross-device link */
#endif

#ifndef ENODEV
#define	ENODEV		19		/* No such device */
#endif

#ifndef ENOTDIR
#define	ENOTDIR		20		/* Not a directory*/
#endif

#ifndef EISDIR
#define	EISDIR		21		/* Is a directory */
#endif

#ifndef EINVAL
#define	EINVAL		22		/* Invalid argument */
#endif

#ifndef ENFILE
#define	ENFILE		23		/* File table overflow */
#endif

#ifndef EMFILE
#define	EMFILE		24		/* Too many open files */
#endif

#ifndef ENOTTY
#define	ENOTTY		25		/* Not a typewriter */
#endif

#ifndef ENAMETOOLONG
#define	ENAMETOOLONG	26		/* File name too long */
#endif

#ifndef EFBIG
#define	EFBIG		27		/* File too large */
#endif

#ifndef ENOSPC
#define	ENOSPC		28		/* No space left on device */
#endif

#ifndef ESPIPE
#define	ESPIPE		29		/* Illegal seek */
#endif

#ifndef EROFS
#define	EROFS		30		/* Read-only file system */
#endif

#ifndef EMLINK
#define	EMLINK		31		/* Too many links */
#endif

#ifndef EPIPE
#define	EPIPE		32		/* Broken pipe */
#endif

#ifndef EDEADLK
#define	EDEADLK		33		/* Resource deadlock avoided */
#endif

#ifndef ENOLCK
#define	ENOLCK		34		/* No locks available */
#endif

#ifndef ENOTSUP
#define	ENOTSUP		35		/* Unsupported value */
#endif

#ifndef EMSGSIZE
#define	EMSGSIZE	36		/* Message size */
#endif

/* ANSI math software */
#ifndef EDOM
#define	EDOM		37		/* Argument too large */
#endif

#ifndef ERANGE
#define	ERANGE		38		/* Result too large */
#endif

/* ipc/network software */

/* argument errors */
#ifndef EDESTADDRREQ
#define	EDESTADDRREQ	40		/* Destination address required */
#endif

#ifndef EPROTOTYPE
#define	EPROTOTYPE	41		/* Protocol wrong type for socket */
#endif

#ifndef ENOPROTOOPT
#define	ENOPROTOOPT	42		/* Protocol not available */
#endif

#ifndef EPROTONOSUPPORT
#define	EPROTONOSUPPORT	43		/* Protocol not supported */
#endif

#ifndef ESOCKTNOSUPPORT
#define	ESOCKTNOSUPPORT	44		/* Socket type not supported */
#endif

#ifndef EOPNOTSUPP
#define	EOPNOTSUPP	45		/* Operation not supported on socket */
#endif

#ifndef EPFNOSUPPORT
#define	EPFNOSUPPORT	46		/* Protocol family not supported */
#endif

#ifndef EAFNOSUPPORT
#define	EAFNOSUPPORT	47		/* Addr family not supported */
#endif

#ifndef EADDRINUSE
#define	EADDRINUSE	48		/* Address already in use */
#endif

#ifndef EADDRNOTAVAIL
#define	EADDRNOTAVAIL	49		/* Can't assign requested address */
#endif

#ifndef ENOTSOCK
#define	ENOTSOCK	50		/* Socket operation on non-socket */
#endif


/* operational errors */
#ifndef ENETUNREACH
#define	ENETUNREACH	51		/* Network is unreachable */
#endif

#ifndef ENETRESET
#define	ENETRESET	52		/* Network dropped connection on reset*/
#endif

#ifndef ECONNABORTED
#define	ECONNABORTED	53		/* Software caused connection abort */
#endif

#ifndef ECONNRESET
#define	ECONNRESET	54		/* Connection reset by peer */
#endif

#ifndef ENOBUFS
#define	ENOBUFS		55		/* No buffer space available */
#endif

#ifndef EISCONN
#define	EISCONN		56		/* Socket is already connected */
#endif

#ifndef ENOTCONN
#define	ENOTCONN	57		/* Socket is not connected */
#endif

#ifndef ESHUTDOWN
#define	ESHUTDOWN	58		/* Can't send after socket shutdown */
#endif

#ifndef ETOOMANYREFS
#define	ETOOMANYREFS	59		/* Too many references: can't splice */
#endif

#ifndef ETIMEDOUT
#define	ETIMEDOUT	60		/* Connection timed out */
#endif

#ifndef ECONNREFUSED
#define	ECONNREFUSED	61		/* Connection refused */
#endif

#ifndef ENETDOWN
#define	ENETDOWN	62		/* Network is down */
#endif

#ifndef ETXTBSY
#define	ETXTBSY		63		/* Text file busy */
#endif

#ifndef ELOOP
#define	ELOOP		64		/* Too many levels of symbolic links */
#endif

#ifndef EHOSTUNREACH
#define	EHOSTUNREACH	65		/* No route to host */
#endif

#ifndef ENOTBLK
#define	ENOTBLK		66		/* Block device required */
#endif

#ifndef EHOSTDOWN
#define	EHOSTDOWN	67		/* Host is down */
#endif


/* non-blocking and interrupt i/o */
#ifndef EINPROGRESS
#define	EINPROGRESS	68		/* Operation now in progress */
#endif

#ifndef EALREADY
#define	EALREADY	69		/* Operation already in progress */
#endif

#ifndef EWOULDBLOCK
#define	EWOULDBLOCK	70		/* Operation would block */
#endif

#ifndef ENOSYS
#define	ENOSYS		71		/* Function not implemented */
#endif

/* aio errors (should be under posix) */
#ifndef ECANCELED
#define	ECANCELED	72		/* Operation canceled */
#endif


/* specific STREAMS errno values */
#ifndef ENOSR
#define ENOSR           74              /* Insufficient memory */
#endif

#ifndef ENOSTR
#define ENOSTR          75              /* STREAMS device required */
#endif

#ifndef EPROTO
#define EPROTO          76              /* Generic STREAMS error */
#endif

#ifndef EBADMSG
#define EBADMSG         77              /* Invalid STREAMS message */
#endif

#ifndef ENODATA
#define ENODATA         78              /* Missing expected message data */
#endif

#ifndef ETIME
#define ETIME           79              /* STREAMS timeout occurred */
#endif

#ifndef ENOMSG
#define ENOMSG          80              /* Unexpected message type */
#endif

#ifndef ERRMAX
#define	ERRMAX		81
#endif


#endif /* __OSA_ERRNO_H__ */

